<?php

if (defined('NO_DIRECT')) {
	if (isset($_GET['i'])) {
		$unfollow_id = intval($_GET['i']);
		$follow = db_result('SELECT * FROM follow WHERE user_by = '.$session['user']['user_id'].' AND user_who = '.$unfollow_id);
		if ($follow === false) {
			// gagal. dia ga ngefollow orang itu
			echo 'gagal. dia ga ngefollow orang itu';
		} else {
			db_query('DELETE FROM follow WHERE user_by = '.$follow['user_by'].' AND user_who = '.$follow['user_who']);
			// berhasil oye oye
			echo 'berhasil oye oye';
		}
	}
}
